IF exists(SELECT * FROM dbo.sysobjects WHERE name='stamboekVervangEinddatumEG' AND xtype='P') 
BEGIN
	DROP PROCEDURE stamboekVervangEinddatumEG
END
GO

CREATE procedure stamboekVervangEinddatumEG(@oud varchar(10),
@nieuw varchar(10))
as
declare @datumOud dateTime
declare @datumNieuw dateTime 
set @datumOud = convert(dateTime,@oud,103)
set @datumNieuw = convert(dateTime,@nieuw,103)

update alleGestarteLln
  set verlatenEGop = @datumNieuw
  where verlatenEGop between @datumOud and dateadd(day,1,@datumOud)